




// 缓存 顶点数据
import {VertexData} from "./vertexData";

export class VertexCache {

    static cache = {};
    static add(name:string,vertexData:VertexData){

        // @ts-ignore
        if (VertexCache.cache[name]){
            throw `alredy has vertexcache by name:${name}`
        }

        // @ts-ignore
        VertexCache.cache[name] = vertexData;
    }

    static get(name:string):VertexData{
        // @ts-ignore
        if (!VertexCache.cache[name]){
            throw `vertexCache ${name} not exist!`
        }
        // @ts-ignore
        return VertexCache.cache[name];
    }

}
